import React, { Component } from "react";
import "../../assets/font_r9skc8oni9/iconfont.css";
import "../../styles/Mine.scss";
import pics from "../../assets/11.jpg";
import * as service from "../../api/index";
import { List } from "antd-mobile";
// import { AntOutline, GlobalOutline, SmileOutline } from "antd-mobile-icons";
class Mine extends Component {
  constructor(props) {
    super(props);
    this.state = {
      list: [],
      timer: "",
    };
  }
  async componentDidMount() {
    var res = await service.user_info({
      userid: localStorage.getItem("userid"),
    });

    this.setState({ name: res.data.data[0].username });
    console.log(res);
  }
  shoucang() {
    this.props.history.push("/index/Shoucang");
  }

  fanhui() {
    this.props.history.go(-1);
  }
  shezhi() {
    this.props.history.push("/Shezhi");
  }

  dizhi() {
    this.props.history.push("/index/Dizhilist");
  }

  dingdan() {
    this.props.history.push("/index/Dingdan");
  }
  render() {
    return (
      <div className="Mine">
        <div className="header">
          <p
            className="iconfont icon-youjiantou"
            onClick={() => {
              this.fanhui();
            }}
          ></p>
          <p>个人中心</p>
          <p
            className="iconfont icon-shezhi"
            onClick={() => {
              this.shezhi();
            }}
          ></p>
        </div>
        <div className="center">
          <img src={pics} alt="" />
          <p>用户10086</p>
        </div>
        <div className="Nav">
          <div className="Nav_top">
            <div className="item">
              <p className="iconfont icon-dingdandaifukuan"></p>
              <h6>待付款</h6>
            </div>

            <div className="item">
              <p className="iconfont icon-daishouhuo"></p>
              <h6>待收货</h6>
            </div>
            <div className="item">
              <p className="iconfont icon-pingjia2"></p>
              <h6>待评价</h6>
            </div>
            <div
              className="item"
              onClick={() => {
                this.dingdan();
              }}
            >
              <p className="iconfont icon-dingdandingdanchaxun"></p>
              <h6>全部订单</h6>
            </div>
          </div>
          <div className="list">
            <List>
              <List.Item
                // prefix={<AntOutline />}
                onClick={() => {
                  this.dizhi();
                }}
              >
                地址管理
              </List.Item>
              <List.Item
                // prefix={<GlobalOutline />}
                onClick={() => {
                  this.shoucang();
                }}
              >
                我的收藏夹
              </List.Item>
              <List.Item
                // prefix={<SmileOutline />}
                onClick={() => {}}
              >
                关于我们
              </List.Item>
            </List>
          </div>
        </div>
      </div>
    );
  }
}

export default Mine;
